package com.asset.dispoal.company.service.commom;

import com.asset.dispoal.company.domain.db.mapper.SysCompanyMapper;
import com.asset.dispoal.company.dto.CompanySelectResponse;
import com.asset.dispoal.company.dto.PlaintiffCourtRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tech.mhuang.pacebox.core.ddd.BaseCommand;
import tech.mhuang.pacebox.springboot.protocol.Result;

import java.util.List;

@Component
@Slf4j
public class QueryCourtByPlaintiffIdCommand implements BaseCommand<PlaintiffCourtRequest, Result<List<CompanySelectResponse>>> {

    @Autowired
    SysCompanyMapper companyMapper;

    @Override
    public Result<List<CompanySelectResponse>> execute(PlaintiffCourtRequest request) {
        return Result.ok(companyMapper.queryCourtByPlaintiffId(request));
    }
}
